<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:viewModels="clr-namespace:Bang_Game.ViewModels"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="Bang_Game.Views.MainWindow"
        x:DataType="viewModels:MainWindowViewModel"
        Icon="/Assets/bang-logo.ico"
        Title="Bang">

    <Window.Styles>
        <Style Selector="Button.OnBackgroundImage">
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="20" />
            <Setter Property="Background" Value="GhostWhite" />
            <Setter Property="Foreground" Value="Black" />
        </Style>

        <Style Selector="TextBlock.TextOnCard">
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="10" />
            <Setter Property="VerticalAlignment" Value="Top" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0, 10, 0, 30 " />
        </Style>

        <Style Selector="TextBlock.TextOnLittleCard">
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="9" />
            <Setter Property="VerticalAlignment" Value="Top" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="TextWrapping" Value="WrapWithOverflow"></Setter>
        </Style>

        <Style Selector="TextBlock.NumberTypeOnCard">
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="8" />
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="Margin" Value="3,50,5,5" />
        </Style>
        <Style Selector="Button.Card">
            <Setter Property="Background" Value="Firebrick" />
            <Setter Property="CornerRadius" Value="3" />
            <Setter Property="Height" Value="120" />
            <Setter Property="Width" Value="80" />
        </Style>
    </Window.Styles>

    <Window.Background>
        <ImageBrush Source="/Assets/startup-background.jpg" Stretch="Fill" />
    </Window.Background>

    <Grid>
        <Grid x:Name="GreetingPage" IsVisible="True">
            <TextBlock Text="Добро пожаловать в Бэнг!"
                       TextAlignment="Center"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Top"
                       FontSize="40"
                       Foreground="Wheat"
                       Margin="65"
                       FontWeight="Bold"
                       Background="#B4FF6800"
                       MaxWidth="10000"
                       Width="10000" />
            <Button x:Name="Continue" Content="Продолжить" Classes="OnBackgroundImage" VerticalAlignment="Bottom"
                    Margin="100"
                    Click="OpenMainMenu_OnClick">
            </Button>
        </Grid>

        <Grid x:Name="MainMenuPage" IsVisible="False">
            <StackPanel VerticalAlignment="Center">
                <Button x:Name="StartButton"
                        Content="Начать"
                        Classes="OnBackgroundImage"
                        Click="StartButton_OnClick" />
                <Button x:Name="RulesButton"
                        Content="Правила"
                        Classes="OnBackgroundImage"
                        Click="Rules_OnClick" />
                <Button x:Name="ExitButton"
                        Content="Выйти"
                        Classes="OnBackgroundImage"
                        Click="CloseWindow_OnClick" />
            </StackPanel>
        </Grid>

        <Grid x:Name="RulesPage" IsVisible="False">
            <ListBox Name="ListBoxRules" ItemsSource="{Binding RuleImages}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Image Source="{Binding }" Margin="-15" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Button
                Content="Назад"
                Classes="OnBackgroundImage"
                VerticalAlignment="Top"
                HorizontalAlignment="Left"
                Click="OpenMainMenu_OnClick"
                HotKey="Escape" />
        </Grid>

        <Border CornerRadius="20" x:Name="NickInput" IsVisible="False" HorizontalAlignment="Center"
                VerticalAlignment="Center" Background="#E64E4E4E" Width="350">
            <StackPanel>
                <TextBlock Margin="20 15" Text="Nickname:" Foreground="White" />
                <TextBox Watermark="Введите свой никнейм" Margin="10" x:Name="Nickname" Text="{Binding Player.Name}" />
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button
                        Content="Назад"
                        Classes="OnBackgroundImage"
                        HorizontalAlignment="Left"
                        Click="OpenMainMenu_OnClick"
                        HotKey="Escape" />
                    <Button
                        Content="Подключиться" IsEnabled="{Binding ElementName=Nickname, Path=Text.Length}"
                        HorizontalAlignment="Right"
                        Classes="OnBackgroundImage"
                        Click="PlayerJoin_OnClick"
                        Command="{Binding ConnectCommand}" />
                </StackPanel>
            </StackPanel>
        </Border>

        <Grid RowDefinitions="Auto,17*, Auto" x:Name="GameGrid" IsVisible="False" VerticalAlignment="Stretch">
            <Grid.Background>
                <ImageBrush Source="../../../Assets/GameBackground.png" Stretch="Fill" />
            </Grid.Background>
            <Grid Grid.Row="0" VerticalAlignment="Top" Background="#0080461C">
                <ListBox ItemsSource="{Binding Player.PlayersList}"
                         x:Name="PlayersListBox"
                         HorizontalAlignment="Left"
                         VerticalAlignment="Stretch"
                         Background="#4680461C"
                         MinHeight="45"
                         Height="{Binding $parent[Grid].Height}">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
                                <Ellipse Fill="{Binding ColorString}" Width="10" Height="10" Margin="10 0 10 0"
                                         HorizontalAlignment="Center" VerticalAlignment="Center">
                                </Ellipse>
                                <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" Foreground="White"
                                           VerticalAlignment="Center" FontSize="16">
                                </TextBlock>
                                <TextBlock Text="{Binding Hp}" HorizontalAlignment="Center" Foreground="White"
                                           VerticalAlignment="Center" FontSize="16" Margin="10 0 10 0">
                                </TextBlock>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                    <TextBlock IsVisible="{Binding IsGoingToReset}" Foreground="White"
                               Margin="15 0 15 0" Text="Карты пойдут в сброс" VerticalAlignment="Center" />
                    <Button x:Name="DropCardsToReset" Command="{Binding DropCardsToResetCommand}"
                            IsEnabled="{Binding Player.Turn}"
                            Background="#9B1212"
                            Foreground="White"
                            Margin="15 0 15 0"
                            Content="Сбросить карты" />
                    <Button x:Name="EndMoveButton" Command="{Binding EndTurnCommand}" IsEnabled="{Binding CanEndTurn}"
                            Background="#9B1212"
                            Foreground="White"
                            Margin="15 0 15 0"
                            Content="Закончить ход" />
                </StackPanel>
            </Grid>
            <Grid Grid.Row="1" ColumnDefinitions="3*,16*" VerticalAlignment="Stretch">
                <Grid Grid.Column="0" Background="#C84B2312">
                    <StackPanel>
                        <TextBlock Foreground="White"> Ваш Ник:</TextBlock>
                        <TextBlock Text="{Binding Player.Name}" Foreground="{Binding Player.ColorString}"
                                   FontWeight="Bold" />
                        <TextBlock Foreground="White"> Ваш уровень здоровья:</TextBlock>
                        <TextBlock Text="{Binding Player.Hp}" Foreground="{Binding Player.ColorString}"
                                   FontWeight="Bold" />
                        <TextBlock Foreground="White"> Ваш герой:</TextBlock>
                        <TextBlock Text="{Binding Player.HeroCard.HeroName}" Foreground="{Binding Player.ColorString}"
                                   FontWeight="Bold" />
                        <TextBlock Foreground="White"> Ваша роль:</TextBlock>
                        <TextBlock Text="{Binding Player.RoleCard.RoleType}" Foreground="{Binding Player.ColorString}"
                                   FontWeight="Bold" />
                        <TextBlock Foreground="White"> Ваша дальнострельность:</TextBlock>
                        <TextBlock Text="{Binding Player.ShotRange}" Foreground="{Binding Player.ColorString}"
                                   FontWeight="Bold" />
                    </StackPanel>
                    <Grid VerticalAlignment="Bottom"
                          IsVisible="{Binding IsChoosing}">
                        <StackPanel>
                        <ListBox ItemsSource="{Binding Player.PlayersList}" Background="#4680461C">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Button CommandParameter="{Binding Id}"
                                            Command="{Binding $parent[Grid].((viewModels:MainWindowViewModel)DataContext).ChoosePlayerCommand}"
                                            IsEnabled="{Binding $parent[Grid].((viewModels:MainWindowViewModel)DataContext).Player.Turn}"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Width="200"
                                            Height="50"
                                            Background="#1FFF0800">
                                        <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"
                                                    Orientation="Horizontal">
                                            <TextBlock Text="{Binding Name}" FontSize="14" Margin="0,0,15, 0"
                                                       Foreground="White" />
                                            <TextBlock Text="{Binding Distance}" FontSize="14" Foreground="White" />
                                        </StackPanel>
                                    </Button>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                        <Button Command="{Binding CloseChoosingCommand}" Width="200" Height="50" Background="#1FFF0800" Foreground="White" Content="Отмена" FontSize="14" FontWeight="Bold" HorizontalAlignment="Center"/>
                        </StackPanel>
                    </Grid>
                </Grid>
                <Grid Grid.Column="1">
                    <Grid ColumnDefinitions="1*,2*,1*" RowDefinitions="1*,2*,1*">
                        <Canvas Grid.Row="0" Grid.Column="1" Background="#0080461C">
                            <StackPanel Canvas.Right="10" Canvas.Top="0" Orientation="Horizontal">
                                <TextBlock Text="Мой ход" Background="Red" FontSize="16" FontWeight="Bold"
                                           Foreground="White" HorizontalAlignment="Center"
                                           IsVisible="{Binding Player.PlayersList[0].Turn}" />
                                <Ellipse Fill="{Binding Player.PlayersList[0].ColorString}" Width="10" Height="10"
                                         Margin="2 2 2 2" VerticalAlignment="Top" HorizontalAlignment="Center" />
                                <TextBlock Text="{Binding Player.PlayersList[0].Name}"
                                           Foreground="White" HorizontalAlignment="Center" />
                            </StackPanel>
                            <TextBlock Canvas.Right="10" Canvas.Top="20"
                                       Text="{Binding Player.PlayersList[0].HeroCard.HeroName}" FontSize="12"
                                       Foreground="White" />

                            <TextBlock Canvas.Right="10" Canvas.Top="40"
                                       Text="ШЕРИФ" FontSize="12"
                                       Foreground="White"
                                       IsVisible="{Binding Player.PlayersList[0].IsSheriff}" />

                            <Path Stroke="{Binding Player.PlayersList[0].ColorString}" StrokeThickness="3"
                                  Canvas.Left="0" Canvas.Top="0" Fill="{Binding Player.PlayersList[0].ColorString}"
                                  Data="M 21,0 
              A 10,10 0 0 0 0,20
              C 5,25 20,35 20,35
              C 20,35 30,30 40,20
              A 10,10 0 0 0 19,0
              " />
                            <TextBlock Text="{Binding Player.PlayersList[0].Hp}"
                                       IsVisible="{Binding Player.PlayersList[0].Hp}" Foreground="Black"
                                       FontWeight="Bold"
                                       Canvas.Left="15" Canvas.Top="5" />
                            <Image Source="../Assets/Cards/PlayCards/PlayCardBack.jpg" Canvas.Left="15" Canvas.Top="40"
                                   Width="40" Height="80" />
                            <TextBlock Text="{Binding Player.PlayersList[0].CardsCount}" Foreground="White"
                                       FontWeight="Bold" Canvas.Left="28" Canvas.Top="65" FontSize="20" />
                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[0].GunCard.Id}" Width="38"
                                    Height="68" Canvas.Left="75" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[0].GunCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[0].GunCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[0].GunCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[0].BarrelCard.Id}" Width="38"
                                    Height="67" Canvas.Left="135" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[0].BarrelCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[0].BarrelCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[0].BarrelCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[0].MustangCard.Id}"
                                    Width="38" Height="67" Canvas.Left="195" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[0].MustangCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[0].MustangCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[0].MustangCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[0].ScopeCard.Id}" Width="38"
                                    Height="67" Canvas.Left="255" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[0].ScopeCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[0].ScopeCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[0].ScopeCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                        </Canvas>

                        <Canvas Grid.Row="1" Grid.Column="0" Background="#0080461C">
                            <StackPanel Canvas.Right="10" Canvas.Top="0" Orientation="Horizontal">
                                <TextBlock Text="Мой ход" Background="Red" FontSize="16" FontWeight="Bold"
                                           Foreground="White" HorizontalAlignment="Center"
                                           IsVisible="{Binding Player.PlayersList[3].Turn}" />
                                <Ellipse Fill="{Binding Player.PlayersList[3].ColorString}" Width="10" Height="10"
                                         Margin="2 2 2 2" VerticalAlignment="Top" HorizontalAlignment="Center" />
                                <TextBlock Text="{Binding Player.PlayersList[3].Name}"
                                           Foreground="White" HorizontalAlignment="Center" />
                            </StackPanel>
                            <TextBlock Canvas.Right="10" Canvas.Top="20"
                                       Text="{Binding Player.PlayersList[3].HeroCard.HeroName}" FontSize="12"
                                       Foreground="White" />

                            <TextBlock Canvas.Right="10" Canvas.Top="40"
                                       Text="ШЕРИФ" FontSize="12"
                                       Foreground="White"
                                       IsVisible="{Binding Player.PlayersList[3].IsSheriff}" />
                            <Path Stroke="{Binding Player.PlayersList[3].ColorString}" StrokeThickness="3"
                                  Canvas.Left="0" Canvas.Top="0" Fill="{Binding Player.PlayersList[3].ColorString}"
                                  Data="M 21,0 
              A 10,10 0 0 0 0,20
              C 5,25 20,35 20,35
              C 20,35 30,30 40,20
              A 10,10 0 0 0 19,0
              " />
                            <TextBlock Text="{Binding Player.PlayersList[3].Hp}"
                                       IsVisible="{Binding Player.PlayersList[3].Hp}" Foreground="Black"
                                       FontWeight="Bold"
                                       Canvas.Left="15" Canvas.Top="5" />
                            <Image Source="../Assets/Cards/PlayCards/PlayCardBack.jpg" Canvas.Left="15"
                                   Canvas.Top="65" Width="40" Height="80" />
                            <TextBlock Text="{Binding Player.PlayersList[3].CardsCount}" Foreground="White"
                                       FontWeight="Bold" Canvas.Left="28" Canvas.Top="90" FontSize="20" />
                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[3].GunCard.Id}" Width="38"
                                    Height="68" Canvas.Left="75" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[3].GunCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[3].GunCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[3].GunCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[3].BarrelCard.Id}" Width="38"
                                    Height="67" Canvas.Left="135" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[3].BarrelCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[3].BarrelCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[3].BarrelCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[3].MustangCard.Id}"
                                    Width="38" Height="67" Canvas.Left="195" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[3].MustangCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[3].MustangCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[3].MustangCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[3].ScopeCard.Id}" Width="38"
                                    Height="67" Canvas.Left="255" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[3].ScopeCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[3].ScopeCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[3].ScopeCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>
                        </Canvas>

                        <Canvas Grid.Row="1" Grid.Column="1" Background="#C5DE750E" x:Name="TableCanvas">
                            <TextBlock Text="Стол" Canvas.Left="2" Canvas.Top="2"
                                       Margin="10,3,10,30" />
                            <TextBlock Text="Ждите, пока карта пропадет:)" Canvas.Bottom="2" Canvas.Right="2" />
                            <Button Canvas.Top="35" Canvas.Left="100" Classes="Card"
                                    IsVisible="{Binding Player.CardOnTable.Id}"
                                    HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="False">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.CardOnTable.Name}" Classes="TextOnCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.CardOnTable.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.CardOnTable.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>
                        </Canvas>

                        <Canvas Grid.Row="1" Grid.Column="2" Background="#0080461C">
                            <StackPanel Canvas.Right="10" Canvas.Top="0" Orientation="Horizontal">
                                <TextBlock Text="Мой ход" Background="Red" FontSize="16" FontWeight="Bold"
                                           Foreground="White" HorizontalAlignment="Center"
                                           IsVisible="{Binding Player.PlayersList[1].Turn}" />
                                <Ellipse Fill="{Binding Player.PlayersList[1].ColorString}" Width="10" Height="10"
                                         Margin="2 2 2 2" VerticalAlignment="Top" HorizontalAlignment="Center" />
                                <TextBlock Text="{Binding Player.PlayersList[1].Name}"
                                           Foreground="White" HorizontalAlignment="Center" />
                            </StackPanel>
                            <TextBlock Canvas.Right="10" Canvas.Top="20"
                                       Text="{Binding Player.PlayersList[1].HeroCard.HeroName}" FontSize="12"
                                       Foreground="White" />
                            <TextBlock Canvas.Right="10" Canvas.Top="40"
                                       Text="ШЕРИФ" FontSize="12"
                                       Foreground="White"
                                       IsVisible="{Binding Player.PlayersList[1].IsSheriff}" />
                            <Path Stroke="{Binding Player.PlayersList[1].ColorString}" StrokeThickness="3"
                                  Canvas.Left="0" Canvas.Top="0" Fill="{Binding Player.PlayersList[1].ColorString}"
                                  Data="M 21,0 
              A 10,10 0 0 0 0,20
              C 5,25 20,35 20,35
              C 20,35 30,30 40,20
              A 10,10 0 0 0 19,0
              " />
                            <TextBlock Text="{Binding Player.PlayersList[1].Hp}"
                                       IsVisible="{Binding Player.PlayersList[1].Hp}" Foreground="Black"
                                       FontWeight="Bold"
                                       Canvas.Left="15" Canvas.Top="5" />
                            <Image Source="../Assets/Cards/PlayCards/PlayCardBack.jpg" Canvas.Left="15"
                                   Canvas.Top="65" Width="40" Height="80" />
                            <TextBlock Text="{Binding Player.PlayersList[1].CardsCount}" Foreground="White"
                                       FontWeight="Bold" Canvas.Left="28" Canvas.Top="90" FontSize="20" />
                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[1].GunCard.Id}" Width="38"
                                    Height="68" Canvas.Left="75" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[1].GunCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[1].GunCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[1].GunCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[1].BarrelCard.Id}" Width="38"
                                    Height="67" Canvas.Left="135" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[1].BarrelCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[1].BarrelCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[1].BarrelCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[1].MustangCard.Id}"
                                    Width="38" Height="67" Canvas.Left="195" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[1].MustangCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[1].MustangCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[1].MustangCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[1].ScopeCard.Id}" Width="38"
                                    Height="67" Canvas.Left="255" Canvas.Top="70">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[1].ScopeCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[1].ScopeCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[1].ScopeCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>
                        </Canvas>

                        <Canvas Grid.Row="2" Grid.Column="1" Background="#0080461C">
                            <StackPanel Canvas.Left="10" Canvas.Top="0" Orientation="Horizontal">
                                <TextBlock Text="Мой ход" Background="Red" FontSize="16" FontWeight="Bold"
                                           Foreground="White" HorizontalAlignment="Center"
                                           IsVisible="{Binding Player.PlayersList[2].Turn}" />
                                <Ellipse Fill="{Binding Player.PlayersList[2].ColorString}" Width="10" Height="10"
                                         Margin="2 2 2 2" VerticalAlignment="Top" HorizontalAlignment="Center" />
                                <TextBlock Text="{Binding Player.PlayersList[2].Name}"
                                           Foreground="White" HorizontalAlignment="Center" />
                            </StackPanel>
                            <TextBlock Canvas.Left="10" Canvas.Top="20"
                                       Text="{Binding Player.PlayersList[2].HeroCard.HeroName}" FontSize="12"
                                       Foreground="White" />
                            <TextBlock Canvas.Left="10" Canvas.Top="40"
                                       Text="ШЕРИФ" FontSize="12"
                                       Foreground="White"
                                       IsVisible="{Binding Player.PlayersList[2].IsSheriff}" />
                            <Path Stroke="{Binding Player.PlayersList[2].ColorString}" StrokeThickness="3"
                                  Canvas.Right="0" Canvas.Top="0" Fill="{Binding Player.PlayersList[2].ColorString}"
                                  Data="M 21,0 
              A 10,10 0 0 0 0,20
              C 5,25 20,35 20,35
              C 20,35 30,30 40,20
              A 10,10 0 0 0 19,0
              " />
                            <TextBlock Text="{Binding Player.PlayersList[2].Hp}"
                                       IsVisible="{Binding Player.PlayersList[2].Hp}" Foreground="Black"
                                       FontWeight="Bold"
                                       Canvas.Right="20" Canvas.Top="5" />
                            <Image Source="../Assets/Cards/PlayCards/PlayCardBack.jpg" Canvas.Right="15"
                                   Canvas.Top="40" Width="40" Height="80" />
                            <TextBlock Text="{Binding Player.PlayersList[2].CardsCount}" Foreground="White"
                                       FontWeight="Bold" Canvas.Right="28" Canvas.Top="65" FontSize="20" />
                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[2].GunCard.Id}" Width="38"
                                    Height="68" Canvas.Right="75" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[2].GunCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[2].GunCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[2].GunCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[2].BarrelCard.Id}" Width="38"
                                    Height="67" Canvas.Right="135" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[2].BarrelCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[2].BarrelCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[2].BarrelCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[2].MustangCard.Id}"
                                    Width="38" Height="67" Canvas.Right="195" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[2].MustangCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[2].MustangCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[2].MustangCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>

                            <Button Classes="Card" IsVisible="{Binding Player.PlayersList[2].ScopeCard.Id}" Width="38"
                                    Height="67" Canvas.Right="255" Canvas.Top="45">
                                <StackPanel>
                                    <TextBlock Text="{Binding Player.PlayersList[2].ScopeCard.Name}"
                                               Classes="TextOnLittleCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Player.PlayersList[2].ScopeCard.Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding Player.PlayersList[2].ScopeCard.CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>
                        </Canvas>
                    </Grid>
                </Grid>
            </Grid>
            <Grid Grid.Row="2" Background="#4680461C">
                <ListBox ItemsSource="{Binding Player.Cards}" MinHeight="142" Background="#4680461C">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Button Classes="Card" CommandParameter="{Binding Id}"
                                    Command="{Binding $parent[Grid].((viewModels:MainWindowViewModel)DataContext).DropCardOnTableCommand}"
                                    IsEnabled="{Binding $parent[Grid].((viewModels:MainWindowViewModel)DataContext).Player.Turn}">
                                <StackPanel>
                                    <TextBlock Text="{Binding Name}" Classes="TextOnCard" />
                                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding Number}"
                                                   Classes="NumberTypeOnCard" />
                                        <TextBlock Text="{Binding CardType}"
                                                   Classes="NumberTypeOnCard" />
                                    </StackPanel>
                                </StackPanel>
                            </Button>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>
        </Grid>
        <Grid IsVisible="{Binding Player.Win}" Background="Black">
            <TextBlock FontSize="50" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">Победа</TextBlock>
        </Grid>
        <Grid IsVisible="{Binding Player.Lose}" Background="Black">
            <TextBlock FontSize="50" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">Поражение</TextBlock>
        </Grid>
    </Grid>
</Window>